package com.gcd;

import java.util.HashMap;
import java.util.Set;

@SuppressWarnings("serial")
public class Pair extends HashMap<String, String> {

	public String get(Integer key) {
		return super.get(key.toString());
	}

	public String put(String key, Integer value) {
		return super.put(key, value.toString());
	}
	
	public String put(String key, Float value) {
		return super.put(key, value.toString());
	}

	public String put(Integer key, Integer value) {
		return super.put(key.toString(), value.toString());
	}
	
	@Override
	public String toString() {
		// Create builder
		StringBuilder sb = new StringBuilder();
		
		// Key set
		Set<String> keys = keySet();
		
		// Build
		sb.append("[");
		for (String s : keys) {
			sb.append("{").append(s).append(":").append(get(s)).append("}, ");
		}
		sb.append("]");
		
		return sb.toString();
	}
}